package com.example.javapracticaltraining.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

/**
 * 
 * @TableName service_type
 */
@TableName(value ="service_type")
@Data
public class ServiceType {
    /**
     * 
     */
    @TableId(value = "type_id", type = IdType.AUTO)
    private Integer typeId;

    /**
     * 
     */
    @TableField(value = "type_name")
    private String typeName;

    /**
     * 
     */
    @TableField(value = "description")
    private String description;

    /**
     * 
     */
    @TableField(value = "service_category")
    private Object serviceCategory;

    /**
     * 预计完成时间(分钟)
     */
    @TableField(value = "estimated_time")
    private Integer estimatedTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ServiceType other = (ServiceType) that;
        return (this.getTypeId() == null ? other.getTypeId() == null : this.getTypeId().equals(other.getTypeId()))
            && (this.getTypeName() == null ? other.getTypeName() == null : this.getTypeName().equals(other.getTypeName()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getServiceCategory() == null ? other.getServiceCategory() == null : this.getServiceCategory().equals(other.getServiceCategory()))
            && (this.getEstimatedTime() == null ? other.getEstimatedTime() == null : this.getEstimatedTime().equals(other.getEstimatedTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTypeId() == null) ? 0 : getTypeId().hashCode());
        result = prime * result + ((getTypeName() == null) ? 0 : getTypeName().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getServiceCategory() == null) ? 0 : getServiceCategory().hashCode());
        result = prime * result + ((getEstimatedTime() == null) ? 0 : getEstimatedTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", typeId=").append(typeId);
        sb.append(", typeName=").append(typeName);
        sb.append(", description=").append(description);
        sb.append(", serviceCategory=").append(serviceCategory);
        sb.append(", estimatedTime=").append(estimatedTime);
        sb.append("]");
        return sb.toString();
    }
}